#include "tcpsocket.h"

TcpSocket::TcpSocket(qintptr handle)
{
    Sock.setSocketDescriptor(handle);
    connect(&this->Sock,&QTcpSocket::readyRead,[=](){
        RawData = Sock.readAll();
        Decode();
        emit sig_getdata(this);
        });

    connect(&this->Sock,&QTcpSocket::disconnected,[=](){
        emit sig_sockdisconnect(this);    
        });

}

void TcpSocket::Decode()
{
    Data = RawData;
}

